<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ taglib tagdir="/WEB-INF/tags/common" prefix="common"%>

<html>
<head>
<jsp:include page="/common/meta.jsp"></jsp:include>
<title></title>
<link rel="stylesheet" type="text/css" media="all"
href="${ctx}/common/jscalendar-1.0/skins/aqua/theme.css" title="Aqua" />
<link rel="alternate stylesheet" type="text/css" media="all"
href="${ctx}/common/jscalendar-1.0/calendar-win2k-1.css"
title="win2k-1" />
<script type="text/javascript"
src="${ctx}/common/jscalendar-1.0/calendar.js"></script>
<script type="text/javascript"
src="${ctx}/common/jscalendar-1.0/lang/calendar-zh_CN.js"></script>
<script type="text/javascript"
src="${ctx}/common/jscalendar-1.0/calendar-setup.js"></script>
   <script type="text/javascript">
   var isEdit="<%=request.getAttribute("isEdit")%>";
  
   function checkField(){
	 // alert(CompleteDate.value);
   }
   
   function uploadFile(){
	   var version= document.getElementById('version');
	   var id= document.getElementById('ID');
	   
	   if(version.value!=null&&version.value!=''){
		   window.location='${ctx}/app/main/prepluguploadf?id='+id.value+'&version='+version.value;
	   }else{
		   alert('请输入版本号');
	   }
   }
   function checkVerNumFormat(){
	   var versionVal=$('#version').val();
	 	var reg=/^V\d+(\.{0,1}\d*$|$)/g;
	 	if(!reg.test(versionVal)){
			alert("请输入正确的版本号");
			$('#version').focus();
		 }else{
			 versionVal=versionVal.substring(1,versionVal.length);
			 if(parseFloat(versionVal)<parseFloat( $('#version').data('backval'))){
				 alert("请输入正确的版本号");
				$('#version').focus();
				}
			 
		}
   }
   $(function(){
	   var verval=$('#version').val();
	   $('#version').data('backval',verval.substring(1,verval.length));
	 });
        </script>
</head>
<body>
<fieldset class="mainbody" >
<form:form id="editplugForm" name="editplugForm" commandName="plugDTO" action="${ctx }/app/main/editplug" onsubmit="checkField()" enctype="multipart/form-data">
<common:errorTable commandName="plugDTO"></common:errorTable>
<table width="100%">
<tr>
<td colspan="2">
<h3>
<c:if test="${isEdit eq 'Y' }">
	更改项目信息
</c:if >
<c:if test="${isEdit eq 'N' }">
	查看项目信息
</c:if >
</h3>

</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td colspan="2" ><common:noteNeedSign/></td>
</tr>
<tr>
<td width="10%">项目名称<common:needSign/>:</td>
<td width="20%">
<form:input path="cpaName"/>
<form:hidden path="ID"/> 
<form:hidden path="verID"/>
<form:hidden path="createUserName"/>
<common:errorSign path="cpaName"></common:errorSign>
</td>
</tr>
<tr>
<td width="10%">当前版本:</td>
<td width="20%" style="color: red;">
	<c:out value="${plugDTO.version}"></c:out>
</td>
</tr>
<tr>
	<td width="10%">更新版本<common:needSign/>:</td>
	<td width="20%">
	<form:input path="version" onblur="checkVerNumFormat();"/>(版本格式以V打头，并且不能小于当前版本,如不更改版本请保持该值为当前版本)
	<common:errorSign path="version"></common:errorSign>
</td>
</tr>
<tr>
	<td width="10%">更新版本生效日期：<common:needSign/>:</td>
	<td width="20%">
	<common:inputDate date="effDateStr"></common:inputDate>
	<common:errorSign path="effDateStr"></common:errorSign>
</td>
</tr>
<tr>
	
	<td width="10%">版本状态：</td>
	<td width="20%">
		<form:select path="verStatus"  >
			<form:option value="A">申请</form:option>   
	        <form:option value="W">未开始</form:option>   
	        <form:option value="D">进行</form:option>   
	        <form:option value="C">完成</form:option>   
	        <form:option value="E">关闭</form:option>   
		</form:select>
		 
	</td>
	</tr>
<tr>
	<td width="10%">开发组：<common:needSign/>:</td>
	<td width="20%">
	<form:select path="implGrpIDStr" items="${plugDTO.grps}" itemLabel="grpName" itemValue="id"></form:select>
	<common:errorSign path="implGrpIDStr"></common:errorSign>
</td>
</tr>
<tr>
	<td width="10%">Watcher组：<common:needSign/>:</td>
	<td width="20%">
	<form:select path="watchGrpIDStr" items="${plugDTO.grps}" itemLabel="grpName" itemValue="id"></form:select>
	<common:errorSign path="watchGrpIDStr"></common:errorSign>
</td>
</tr>
<tr>
	<form:hidden path="filePath"/>
	<td width="10%">文件路径：</td>
	<td width="40%"><input type="file" id="upFile" name="upFile" /></td>
</tr>
<tr>
<td>插件描述<common:needSign/>:</td>
<td>
<form:textarea path="infoDesc" cols="50" rows="5"/>

<common:errorSign path="infoDesc"></common:errorSign>
</td>

</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td colspan="2">
<c:if test="${isEdit eq 'Y' }">
	<input type="submit" value="确定" />&nbsp;&nbsp;
		<input type="button" onclick="clearForm(editplugForm);" value="清除"/>
</c:if >
<c:if test="${isEdit eq 'A' }">
	<input type="submit" value="确定" />&nbsp;&nbsp;
		<input type="button" onclick="clearForm(editplugForm);" value="清除"/>
</c:if >
</td>
</tr>
</table>
</form:form>
</fieldset>
</body>
</html>